package com.audible.library.session;

import com.audible.library.view.backing.UserInfo;
import java.io.Serializable;
import javax.enterprise.context.SessionScoped;
import javax.inject.Named;

/**
 * The object of this class represents a user's session in the application.
 * This object will be stored in HTTP session and will stay alive as long as
 * user's session is active.
 *
 * This object can store all user's specific data. It is basically an identity of
 * a logged in user.
 *
 * @author Jigar Shah
 * @version 0.1
 */
@Named
@SessionScoped
public class UserSession implements Serializable {
    
    private static final long serialVersionUID = 6169284614012724960L;

    /** Hard coding user ID for testing purpose. This user ID must match what we have in the database as PK */
    private int userID = 1;

    /** User related information */
    private UserInfo userInfo;

    public UserSession() {
    }
  
    /**
     * @return the userInfo
     */
    public UserInfo getUserInfo() {
        return userInfo;
    }

    /**
     * @param userInfo the userInfo to set
     */
    public void setUserInfo(UserInfo userInfo) {
        this.userInfo = userInfo;
    }

    /**
     * @return the userID
     */
    public int getUserID() {
        return userID;
    }

    /**
     * @param userID the userID to set
     */
    public void setUserID(int userID) {
        this.userID = userID;
    }
}
